home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / network / base / netkit-b.07- < prev    next >
Encoding:
Text File  |  1996-11-17  |  26.2 KB  |  954 lines

  1. diff -r -C2 --new-file NetKit-B-0.07/ChangeLog NetKit-B-0.07A/ChangeLog
  2. *** NetKit-B-0.07/ChangeLog    Mon Jul 22 05:54:50 1996
  3. --- NetKit-B-0.07A/ChangeLog    Fri Jul 26 00:44:35 1996
  4. ***************
  5. *** 1,3 ****
  6. ! New in 0.07: (16-Jul-1996)
  7.   - removed portmap; use Wietse Venema's portmap.
  8.   - removed rdist; use rdist 6.x distributed separately.
  9. --- 1,10 ----
  10. ! New in 0.07A: (25-Jul-1996)
  11. ! - fixed the top-level makefile.
  12. ! - removed old versions of rpcgen and slattach.
  13. ! - fixed a bug in telnet where the escape character was being ignored.
  14. ! - fixed a bug in telnetd; now uses the correct names for the last ptys
  15. !   (that is, ptya0-ptyef, not ptyA0-ptyEf.)
  16. ! New in 0.07: (23-Jul-1996)
  17.   - removed portmap; use Wietse Venema's portmap.
  18.   - removed rdist; use rdist 6.x distributed separately.
  19. diff -r -C2 --new-file NetKit-B-0.07/MCONFIG NetKit-B-0.07A/MCONFIG
  20. *** NetKit-B-0.07/MCONFIG    Mon Jul 22 05:46:24 1996
  21. --- NetKit-B-0.07A/MCONFIG    Fri Jul 26 00:30:37 1996
  22. ***************
  23. *** 46,49 ****
  24. --- 46,55 ----
  25.   #
  26.   # On the PowerPC, you probably want to add -fsigned-char to CFLAGS.
  27. + #
  28. + # Note: if talk breaks because it can't find "unctrl.h", your ncurses 
  29. + # package is not installed correctly. Either link /usr/include/unctrl.h
  30. + # to /usr/include/ncurses/unctrl.h, fix /usr/include/ncurses/curses.h to
  31. + # include <ncurses/unctrl.h> instead of <unctrl.h>, or hack around the 
  32. + # problem by putting -I/usr/include/ncurses in the CFLAGS.
  33.   
  34.   CC=gcc
  35. diff -r -C2 --new-file NetKit-B-0.07/Makefile NetKit-B-0.07A/Makefile
  36. *** NetKit-B-0.07/Makefile    Sun Jul 21 04:25:54 1996
  37. --- NetKit-B-0.07A/Makefile    Fri Jul 26 01:32:38 1996
  38. ***************
  39. *** 14,19 ****
  40.   # routed    (deprecated due to being totally broken beyond hope; use gated)
  41.   # rup        (doesn't compile...)
  42. - # rpcgen    (obsolete)
  43. - # slattach    (obsolete)
  44.   #
  45.   # These programs are not supplied at all any more:
  46. --- 14,17 ----
  47. ***************
  48. *** 23,33 ****
  49.   
  50.   
  51. ! all:
  52. !     for i in $(SUB); do make -C  $$i; done
  53.   
  54. ! install:
  55. !     for i in $(SUB); do make -C  $$i install; done
  56.   
  57. ! clean:
  58. !     for i in $(SUB); do make -C  $$i clean; done
  59.   
  60. --- 21,34 ----
  61.   
  62.   
  63. ! %.build:
  64. !     $(MAKE)-C$(patsubst %.build, %, $@)
  65.   
  66. ! %.install:
  67. !     $(MAKE)-C$(patsubst %.install, %, $@) install
  68.   
  69. ! %.clean:
  70. !     $(MAKE)-C$(patsubst %.clean, %, $@) clean
  71.   
  72. + all:     $(patsubst %, %.build, $(SUB))
  73. + install: $(patsubst %, %.install, $(SUB))
  74. + clean:   $(patsubst %, %.clean, $(SUB))
  75. diff -r -C2 --new-file NetKit-B-0.07/README NetKit-B-0.07A/README
  76. *** NetKit-B-0.07/README    Mon Jul 22 17:12:47 1996
  77. --- NetKit-B-0.07A/README    Fri Jul 26 00:31:41 1996
  78. ***************
  79. *** 1,6 ****
  80. ! This is NetKit-B-0.07.
  81.   
  82.   This is probably the last or next to last NetKit-B. NetKit-A has
  83.   already officially ceased to exist.
  84.   
  85.   In the future the components of the NetKit packages will be available
  86. --- 1,8 ----
  87. ! This is NetKit-B-0.07A.
  88.   
  89.   This is probably the last or next to last NetKit-B. NetKit-A has
  90.   already officially ceased to exist.
  91. + NetKit-B-0.07A fixes some stupid bugs in NetKit-B-0.07.
  92.   
  93.   In the future the components of the NetKit packages will be available
  94. diff -r -C2 --new-file NetKit-B-0.07/rexecd/rexecd.c NetKit-B-0.07A/rexecd/rexecd.c
  95. *** NetKit-B-0.07/rexecd/rexecd.c    Tue Jul 23 20:15:54 1996
  96. --- NetKit-B-0.07A/rexecd/rexecd.c    Fri Jul 26 00:51:50 1996
  97. ***************
  98. *** 40,44 ****
  99.    */
  100.   char rcsid[] = 
  101. !   "$Id: rexecd.c,v 1.9 1996/07/24 00:15:51 dholland Exp $";
  102.   
  103.   
  104. --- 40,44 ----
  105.    */
  106.   char rcsid[] = 
  107. !   "$Id: rexecd.c,v 1.10 1996/07/26 04:51:44 dholland Exp $";
  108.   
  109.   
  110. ***************
  111. *** 310,318 ****
  112.           }
  113.           }
  114. - #endif /* !USE_PAM */
  115.           fclose(fp);
  116.       }
  117.       else syslog(LOG_ERR, "cannot open /etc/ftpusers");
  118.   #endif
  119.   
  120.       /* Log successful attempts. */
  121. --- 310,318 ----
  122.           }
  123.           }
  124.           fclose(fp);
  125.       }
  126.       else syslog(LOG_ERR, "cannot open /etc/ftpusers");
  127.   #endif
  128. + #endif /* !USE_PAM */
  129.   
  130.       /* Log successful attempts. */
  131. diff -r -C2 --new-file NetKit-B-0.07/rlogind/Makefile NetKit-B-0.07A/rlogind/Makefile
  132. *** NetKit-B-0.07/rlogind/Makefile    Tue Jul 23 04:19:13 1996
  133. --- NetKit-B-0.07A/rlogind/Makefile    Fri Jul 26 00:53:04 1996
  134. ***************
  135. *** 8,13 ****
  136.   ifeq ($(USE_PAM),1)
  137.   CFLAGS += -DUSE_PAM
  138. ! LDFLAGS += -ldl -lpam
  139. ! OBJS += pamconv.o
  140.   endif
  141.   
  142. --- 8,12 ----
  143.   ifeq ($(USE_PAM),1)
  144.   CFLAGS += -DUSE_PAM
  145. ! LIBS += -ldl -lpam -lpam_misc
  146.   endif
  147.   
  148. diff -r -C2 --new-file NetKit-B-0.07/rlogind/pamconv.c NetKit-B-0.07A/rlogind/pamconv.c
  149. *** NetKit-B-0.07/rlogind/pamconv.c    Tue Jul 23 03:42:50 1996
  150. --- NetKit-B-0.07A/rlogind/pamconv.c    Wed Dec 31 19:00:00 1969
  151. ***************
  152. *** 1,157 ****
  153. - /*
  154. -  * Modifications for Linux-PAM: Al Longyear <longyear@netcom.com>
  155. -  *   General code clean up: Andrew Morgan <morgan@physics.ucla.edu>
  156. -  *   Re-built with #ifdef USE_PAM: Michael K. Johnson <johnsonm@redhat.com>,
  157. -  *   Red Hat Software
  158. -  *
  159. -  *   The Linux-PAM mailing list (25JUN96) <pam-list@redhat.com>
  160. -  */
  161. - #ifdef USE_PAM
  162. - /* conversation function and static variables for communication */
  163. - /*
  164. -  * A generic conversation function for text based applications
  165. -  *
  166. -  * Written by Andrew Morgan <morgan@physics.ucla.edu>
  167. -  *
  168. -  */
  169. - #include <stdio.h>
  170. - #include <stdlib.h>
  171. - #include <string.h>
  172. - #include <unistd.h>
  173. - #include <security/pam_appl.h>
  174. - #define INPUTSIZE PAM_MAX_MSG_SIZE
  175. - #define CONV_ECHO_ON  1
  176. - #define CONV_ECHO_OFF 0
  177. - #define _pam_overwrite(x) \
  178. - { \
  179. -      register char *xx; \
  180. -      if ((xx=x)) \
  181. -           while (*xx) \
  182. -                *xx++ = '\0'; \
  183. - }
  184. - static char *read_string(int echo, const char *remark)
  185. - {
  186. -      char buffer[INPUTSIZE];
  187. -      char *text,*tmp;
  188. -      if (!echo) {
  189. -          tmp = getpass(remark);
  190. -          text = strdup(tmp);       /* get some space for this text */
  191. -          _pam_overwrite(tmp);       /* overwrite the old record of
  192. -                                      * the password */
  193. -      } else {
  194. -          fprintf(stderr,"%s",remark);
  195. -          text = fgets(buffer,INPUTSIZE-1,stdin);
  196. -          if (text) {
  197. -               tmp = buffer + strlen(buffer);
  198. -               while (tmp > buffer && (*--tmp == '\n'))
  199. -                    *tmp = '\0';
  200. -               text = strdup(buffer);  /* get some space for this text */
  201. -          }
  202. -      }
  203. -      return (text);
  204. - }
  205. - #define REPLY_CHUNK 5
  206. - static void drop_reply(struct pam_response *reply, int replies)
  207. - {
  208. -      int i;
  209. -      for (i=0; i<replies; ++i) {
  210. -          _pam_overwrite(reply[i].resp);      /* might be a password */
  211. -          free(reply[i].resp);
  212. -      }
  213. -      if (reply)
  214. -          free(reply);
  215. - }
  216. - int misc_conv(int num_msg, const struct pam_message **msgm,
  217. -                     struct pam_response **response, void *appdata_ptr)
  218. - {
  219. -      int count=0,replies=0,space=0;
  220. -      struct pam_response *reply=NULL;
  221. -      char *string=NULL;
  222. -      for (count=0; count < num_msg; ++count) {
  223. -          switch (msgm[count]->msg_style) {
  224. -          case PAM_PROMPT_ECHO_OFF:
  225. -               string = read_string(CONV_ECHO_OFF,msgm[count]->msg);
  226. -               if (string == NULL) {
  227. -                    drop_reply(reply,replies);
  228. -                    return (PAM_CONV_ERR);
  229. -               }
  230. -               break;
  231. -          case PAM_PROMPT_ECHO_ON:
  232. -               string = read_string(CONV_ECHO_ON,msgm[count]->msg);
  233. -               if (string == NULL) {
  234. -                    drop_reply(reply,replies);
  235. -                    return (PAM_CONV_ERR);
  236. -               }
  237. -               break;
  238. -          case PAM_ERROR_MSG:
  239. -               fprintf(stderr,"%s\n",msgm[count]->msg);
  240. -               break;
  241. -          case PAM_TEXT_INFO:
  242. -               fprintf(stderr,"%s\n",msgm[count]->msg);
  243. -               break;
  244. -          default:
  245. -               fprintf(stderr, "erroneous conversation (%d)\n"
  246. -                       ,msgm[count]->msg_style);
  247. -               drop_reply(reply,replies);
  248. -               return (PAM_CONV_ERR);
  249. -          }
  250. -          if (string) {     /* must add to reply array */
  251. -               struct pam_response *ptmp;
  252. -               /* do we need a larger reply array ? */
  253. -               if (space <= replies) {
  254. -                    space += REPLY_CHUNK;
  255. -                    ptmp = (struct pam_response *)
  256. -                         realloc(reply, space*sizeof(struct pam_response));
  257. -                    if (ptmp == NULL) {
  258. -                         drop_reply(reply,replies);
  259. -                        return PAM_CONV_ERR;        /* ran out of memory */
  260. -                    }
  261. -                    reply = ptmp;                       /* enlarged array*/
  262. -               }
  263. -               /* add string to list of responses */
  264. -               reply[replies].resp_retcode = 0;
  265. -               reply[replies++].resp = string;
  266. -               string = NULL;
  267. -          }
  268. -      }
  269. -      /* do we need to bother with a response? */
  270. -      if (reply) {
  271. -          /* note, this pam_response structure (array) will be
  272. -           * free()'d by the module */
  273. -          *response = reply;
  274. -      }
  275. -      return PAM_SUCCESS;
  276. - }
  277. - struct pam_conv conv = {
  278. -     misc_conv,
  279. -     NULL
  280. - };
  281. - #endif /* USE_PAM */
  282. --- 0 ----
  283. diff -r -C2 --new-file NetKit-B-0.07/rlogind/rlogind.c NetKit-B-0.07A/rlogind/rlogind.c
  284. *** NetKit-B-0.07/rlogind/rlogind.c    Tue Jul 23 04:19:00 1996
  285. --- NetKit-B-0.07A/rlogind/rlogind.c    Fri Jul 26 01:08:21 1996
  286. ***************
  287. *** 50,54 ****
  288.    */
  289.   char rcsid[] = 
  290. !   "$Id: rlogind.c,v 1.11 1996/07/23 08:18:58 dholland Exp $";
  291.   
  292.   /*
  293. --- 50,54 ----
  294.    */
  295.   char rcsid[] = 
  296. !   "$Id: rlogind.c,v 1.13 1996/07/26 05:08:18 dholland Exp $";
  297.   
  298.   /*
  299. ***************
  300. *** 75,78 ****
  301. --- 75,79 ----
  302.   
  303.   #include <pwd.h>
  304. + #include <grp.h>
  305.   #include <syslog.h>
  306.   #include <errno.h>
  307. ***************
  308. *** 83,88 ****
  309.   
  310.   #ifdef USE_PAM
  311. ! #include <grp.h>
  312.   #include <security/pam_appl.h>
  313.   #endif
  314.   
  315. --- 84,90 ----
  316.   
  317.   #ifdef USE_PAM
  318. ! #include <sys/types.h>
  319.   #include <security/pam_appl.h>
  320. + #include <security/pam_misc.h>
  321.   #endif
  322.   
  323. ***************
  324. *** 134,137 ****
  325. --- 136,140 ----
  326.       int on = 1, fromlen;
  327.       struct sockaddr_in from;
  328. +     _check_rhosts_file = 1;     /* default */
  329.   
  330.       openlog("rlogind", LOG_PID | LOG_CONS, LOG_AUTH);
  331. ***************
  332. *** 311,321 ****
  333.               }
  334.   #ifdef USE_PAM
  335. !             pam_end(pamh, PAM_AUTH_ERR);
  336. ! /* I gather that PAM precludes dropping to straight login or something. (?) */
  337. ! #else
  338.               execl(_PATH_LOGIN, "login", "-p",
  339.                     "-h", hp->h_name, lusername, 0);
  340.               /* should not return... */
  341. - #endif
  342.           }
  343.           fatal(STDERR_FILENO, _PATH_LOGIN, 1);
  344. --- 314,322 ----
  345.               }
  346.   #ifdef USE_PAM
  347. !             pam_end(pamh, PAM_SUCCESS);
  348. ! #endif
  349.               execl(_PATH_LOGIN, "login", "-p",
  350.                     "-h", hp->h_name, lusername, 0);
  351.               /* should not return... */
  352.           }
  353.           fatal(STDERR_FILENO, _PATH_LOGIN, 1);
  354. ***************
  355. *** 508,512 ****
  356.           logwtmp(p, "", "");
  357.   #ifdef USE_PAM
  358. -        pam_close_session(pamh, 0);
  359.          pam_end (pamh, PAM_SUCCESS);
  360.   #endif
  361. --- 509,512 ----
  362. ***************
  363. *** 554,558 ****
  364.   
  365.   #ifdef USE_PAM
  366. -     pam_close_session(pamh, 0);
  367.       pam_end (pamh, PAM_SUCCESS);
  368.   #endif
  369. --- 554,557 ----
  370. ***************
  371. *** 566,570 ****
  372.   #ifdef USE_PAM
  373.       char c;
  374. !     extern struct pam_conv conv;
  375.           int retval;
  376.   #endif /* USE_PAM */
  377. --- 565,572 ----
  378.   #ifdef USE_PAM
  379.       char c;
  380. !     static struct pam_conv conv = {
  381. !       misc_conv,
  382. !       NULL
  383. !     };
  384.           int retval;
  385.   #endif /* USE_PAM */
  386. ***************
  387. *** 600,608 ****
  388.                  if (retval == PAM_SUCCESS)
  389.                          break;
  390. !                if (retval == PAM_AUTHTOKEN_REQD)
  391.                          retval = pam_chauthtok (pamh,PAM_CHANGE_EXPIRED_AUTHTOK);
  392. !        } while (retval == PAM_SUCCESS);
  393.   
  394. !        if (retval == PAM_SUCCESS) {
  395.                  if (setgid(pwd->pw_gid) != 0) {
  396.                          fprintf(stderr, "cannot assume gid\n");
  397. --- 602,621 ----
  398.                  if (retval == PAM_SUCCESS)
  399.                          break;
  400. !                if (retval == PAM_AUTHTOKEN_REQD) {
  401.                          retval = pam_chauthtok (pamh,PAM_CHANGE_EXPIRED_AUTHTOK);
  402. !                    if(retval == PAM_SUCCESS)
  403. !              /* Try authentication again if passwd change
  404. !                 succeeded.  Don't try again if it didn't;
  405. !                 sysadmin might not want passwords changed
  406. !                 over the next, and might have set password
  407. !                 to pam_deny.so to disable it... */
  408. !              continue;
  409. !            }
  410. !        } while (0); /* We have the while(0) here because it is either using
  411. !                that and the breaks, or goto's */
  412. !     /* eww. -dah */
  413.   
  414. !     if (retval == PAM_SUCCESS) {
  415.                  if (setgid(pwd->pw_gid) != 0) {
  416.                          fprintf(stderr, "cannot assume gid\n");
  417. ***************
  418. *** 616,630 ****
  419.   
  420.                  retval = pam_setcred(pamh, PAM_CRED_ESTABLISH);
  421. !        }
  422.   
  423. !        if (retval == PAM_SUCCESS)
  424. !                retval = pam_open_session(pamh,0);
  425. !        return (retval ^ PAM_SUCCESS);
  426. ! #else
  427.   
  428.       if (pwd->pw_uid == 0)
  429.           return(-1);
  430.       return(ruserok(host, 0, rusername, lusername));
  431. ! #endif /* USE_PAM */
  432.   }
  433.   
  434. --- 629,647 ----
  435.   
  436.                  retval = pam_setcred(pamh, PAM_CRED_ESTABLISH);
  437. !     }
  438.   
  439. !     if (retval != PAM_SUCCESS) {
  440. !         syslog(LOG_ERR,"PAM authentication failed for in.rlogind");
  441. !         fatal(STDERR_FILENO, "login failed", 0);
  442. !         /* no return */
  443. !     }
  444. !     return 0;
  445. ! #else /* !USE_PAM */
  446.   
  447.       if (pwd->pw_uid == 0)
  448.           return(-1);
  449.       return(ruserok(host, 0, rusername, lusername));
  450. ! #endif /* PAM */
  451.   }
  452.   
  453. diff -r -C2 --new-file NetKit-B-0.07/rpc.rusersd/Makefile NetKit-B-0.07A/rpc.rusersd/Makefile
  454. *** NetKit-B-0.07/rpc.rusersd/Makefile    Sat Jul 20 16:52:53 1996
  455. --- NetKit-B-0.07A/rpc.rusersd/Makefile    Fri Jul 26 01:31:15 1996
  456. ***************
  457. *** 8,11 ****
  458. --- 8,13 ----
  459.   #  .endif
  460.   
  461. + RPCGEN=../rpcgen.new/rpcgen
  462.   # Doesn't compile cleanly with -Wall
  463.   CFLAGS = -O2 -D__USE_BSD_SIGNAL -I../include
  464. ***************
  465. *** 17,32 ****
  466.   
  467.   rusers.h: ../include/rpcsvc/rusers.x
  468. !     ../rpcgen.new/rpcgen -h -o rusers.h ../include/rpcsvc/rusers.x
  469.   
  470.   rusers_xdr.c: ../include/rpcsvc/rusers.x
  471. !     ../rpcgen.new/rpcgen -c -C -o rusers_xdr.c ../include/rpcsvc/rusers.x
  472.   
  473.   rnusers_xdr.o: rnusers_xdr.c rnusers.h
  474.   
  475.   rnusers.h: ../include/rpcsvc/rnusers.x
  476. !     ../rpcgen.new/rpcgen -h -o rnusers.h ../include/rpcsvc/rnusers.x
  477.   
  478.   rnusers_xdr.c: ../include/rpcsvc/rnusers.x
  479. !     ../rpcgen.new/rpcgen -c -C -o rnusers_xdr.c ../include/rpcsvc/rnusers.x
  480.   
  481.   install: rusersd
  482. --- 19,34 ----
  483.   
  484.   rusers.h: ../include/rpcsvc/rusers.x
  485. !     $(RPCGEN) -h -o rusers.h ../include/rpcsvc/rusers.x
  486.   
  487.   rusers_xdr.c: ../include/rpcsvc/rusers.x
  488. !     $(RPCGEN) -c -C -o rusers_xdr.c ../include/rpcsvc/rusers.x
  489.   
  490.   rnusers_xdr.o: rnusers_xdr.c rnusers.h
  491.   
  492.   rnusers.h: ../include/rpcsvc/rnusers.x
  493. !     $(RPCGEN) -h -o rnusers.h ../include/rpcsvc/rnusers.x
  494.   
  495.   rnusers_xdr.c: ../include/rpcsvc/rnusers.x
  496. !     $(RPCGEN) -c -C -o rnusers_xdr.c ../include/rpcsvc/rnusers.x
  497.   
  498.   install: rusersd
  499. diff -r -C2 --new-file NetKit-B-0.07/rshd/Makefile NetKit-B-0.07A/rshd/Makefile
  500. *** NetKit-B-0.07/rshd/Makefile    Mon Jul 22 05:43:58 1996
  501. --- NetKit-B-0.07A/rshd/Makefile    Fri Jul 26 01:03:51 1996
  502. ***************
  503. *** 8,13 ****
  504.   ifeq ($(USE_PAM),1)
  505.   CFLAGS += -DUSE_PAM
  506. ! LDFLAGS += -ldl -lpam
  507. ! OBJS += pamconv.o
  508.   endif
  509.   
  510. --- 8,12 ----
  511.   ifeq ($(USE_PAM),1)
  512.   CFLAGS += -DUSE_PAM
  513. ! LIBS += -ldl -lpam -lpam_misc
  514.   endif
  515.   
  516. diff -r -C2 --new-file NetKit-B-0.07/rshd/pamconv.c NetKit-B-0.07A/rshd/pamconv.c
  517. *** NetKit-B-0.07/rshd/pamconv.c    Tue Jul 23 03:42:50 1996
  518. --- NetKit-B-0.07A/rshd/pamconv.c    Wed Dec 31 19:00:00 1969
  519. ***************
  520. *** 1,157 ****
  521. - /*
  522. -  * Modifications for Linux-PAM: Al Longyear <longyear@netcom.com>
  523. -  *   General code clean up: Andrew Morgan <morgan@physics.ucla.edu>
  524. -  *   Re-built with #ifdef USE_PAM: Michael K. Johnson <johnsonm@redhat.com>,
  525. -  *   Red Hat Software
  526. -  *
  527. -  *   The Linux-PAM mailing list (25JUN96) <pam-list@redhat.com>
  528. -  */
  529. - #ifdef USE_PAM
  530. - /* conversation function and static variables for communication */
  531. - /*
  532. -  * A generic conversation function for text based applications
  533. -  *
  534. -  * Written by Andrew Morgan <morgan@physics.ucla.edu>
  535. -  *
  536. -  */
  537. - #include <stdio.h>
  538. - #include <stdlib.h>
  539. - #include <string.h>
  540. - #include <unistd.h>
  541. - #include <security/pam_appl.h>
  542. - #define INPUTSIZE PAM_MAX_MSG_SIZE
  543. - #define CONV_ECHO_ON  1
  544. - #define CONV_ECHO_OFF 0
  545. - #define _pam_overwrite(x) \
  546. - { \
  547. -      register char *xx; \
  548. -      if ((xx=x)) \
  549. -           while (*xx) \
  550. -                *xx++ = '\0'; \
  551. - }
  552. - static char *read_string(int echo, const char *remark)
  553. - {
  554. -      char buffer[INPUTSIZE];
  555. -      char *text,*tmp;
  556. -      if (!echo) {
  557. -          tmp = getpass(remark);
  558. -          text = strdup(tmp);       /* get some space for this text */
  559. -          _pam_overwrite(tmp);       /* overwrite the old record of
  560. -                                      * the password */
  561. -      } else {
  562. -          fprintf(stderr,"%s",remark);
  563. -          text = fgets(buffer,INPUTSIZE-1,stdin);
  564. -          if (text) {
  565. -               tmp = buffer + strlen(buffer);
  566. -               while (tmp > buffer && (*--tmp == '\n'))
  567. -                    *tmp = '\0';
  568. -               text = strdup(buffer);  /* get some space for this text */
  569. -          }
  570. -      }
  571. -      return (text);
  572. - }
  573. - #define REPLY_CHUNK 5
  574. - static void drop_reply(struct pam_response *reply, int replies)
  575. - {
  576. -      int i;
  577. -      for (i=0; i<replies; ++i) {
  578. -          _pam_overwrite(reply[i].resp);      /* might be a password */
  579. -          free(reply[i].resp);
  580. -      }
  581. -      if (reply)
  582. -          free(reply);
  583. - }
  584. - int misc_conv(int num_msg, const struct pam_message **msgm,
  585. -                     struct pam_response **response, void *appdata_ptr)
  586. - {
  587. -      int count=0,replies=0,space=0;
  588. -      struct pam_response *reply=NULL;
  589. -      char *string=NULL;
  590. -      for (count=0; count < num_msg; ++count) {
  591. -          switch (msgm[count]->msg_style) {
  592. -          case PAM_PROMPT_ECHO_OFF:
  593. -               string = read_string(CONV_ECHO_OFF,msgm[count]->msg);
  594. -               if (string == NULL) {
  595. -                    drop_reply(reply,replies);
  596. -                    return (PAM_CONV_ERR);
  597. -               }
  598. -               break;
  599. -          case PAM_PROMPT_ECHO_ON:
  600. -               string = read_string(CONV_ECHO_ON,msgm[count]->msg);
  601. -               if (string == NULL) {
  602. -                    drop_reply(reply,replies);
  603. -                    return (PAM_CONV_ERR);
  604. -               }
  605. -               break;
  606. -          case PAM_ERROR_MSG:
  607. -               fprintf(stderr,"%s\n",msgm[count]->msg);
  608. -               break;
  609. -          case PAM_TEXT_INFO:
  610. -               fprintf(stderr,"%s\n",msgm[count]->msg);
  611. -               break;
  612. -          default:
  613. -               fprintf(stderr, "erroneous conversation (%d)\n"
  614. -                       ,msgm[count]->msg_style);
  615. -               drop_reply(reply,replies);
  616. -               return (PAM_CONV_ERR);
  617. -          }
  618. -          if (string) {     /* must add to reply array */
  619. -               struct pam_response *ptmp;
  620. -               /* do we need a larger reply array ? */
  621. -               if (space <= replies) {
  622. -                    space += REPLY_CHUNK;
  623. -                    ptmp = (struct pam_response *)
  624. -                         realloc(reply, space*sizeof(struct pam_response));
  625. -                    if (ptmp == NULL) {
  626. -                         drop_reply(reply,replies);
  627. -                        return PAM_CONV_ERR;        /* ran out of memory */
  628. -                    }
  629. -                    reply = ptmp;                       /* enlarged array*/
  630. -               }
  631. -               /* add string to list of responses */
  632. -               reply[replies].resp_retcode = 0;
  633. -               reply[replies++].resp = string;
  634. -               string = NULL;
  635. -          }
  636. -      }
  637. -      /* do we need to bother with a response? */
  638. -      if (reply) {
  639. -          /* note, this pam_response structure (array) will be
  640. -           * free()'d by the module */
  641. -          *response = reply;
  642. -      }
  643. -      return PAM_SUCCESS;
  644. - }
  645. - struct pam_conv conv = {
  646. -     misc_conv,
  647. -     NULL
  648. - };
  649. - #endif /* USE_PAM */
  650. --- 0 ----
  651. diff -r -C2 --new-file NetKit-B-0.07/rshd/rshd.c NetKit-B-0.07A/rshd/rshd.c
  652. *** NetKit-B-0.07/rshd/rshd.c    Tue Jul 23 20:16:41 1996
  653. --- NetKit-B-0.07A/rshd/rshd.c    Fri Jul 26 01:05:44 1996
  654. ***************
  655. *** 43,47 ****
  656.    * From: @(#)rshd.c    5.38 (Berkeley) 3/2/91
  657.    */
  658. ! char rcsid[] = "$Id: rshd.c,v 1.7 1996/07/24 00:16:36 dholland Exp $";
  659.   
  660.   /*
  661. --- 43,47 ----
  662.    * From: @(#)rshd.c    5.38 (Berkeley) 3/2/91
  663.    */
  664. ! char rcsid[] = "$Id: rshd.c,v 1.8 1996/07/26 05:05:41 dholland Exp $";
  665.   
  666.   /*
  667. ***************
  668. *** 79,82 ****
  669. --- 79,83 ----
  670.   #ifdef USE_PAM
  671.   #include <security/pam_appl.h>
  672. + #include <security/pam_misc.h>
  673.   static pam_handle_t *pamh;
  674.   static int retcode;
  675. ***************
  676. *** 104,108 ****
  677.       int ch, on = 1, fromlen;
  678.       struct sockaddr_in from;
  679.       openlog("rshd", LOG_PID | LOG_ODELAY, LOG_DAEMON);
  680.   
  681. --- 105,109 ----
  682.       int ch, on = 1, fromlen;
  683.       struct sockaddr_in from;
  684. !     _check_rhosts_file=1;
  685.       openlog("rshd", LOG_PID | LOG_ODELAY, LOG_DAEMON);
  686.   
  687. ***************
  688. *** 201,205 ****
  689.       char remotehost[2 * MAXHOSTNAMELEN + 1];
  690.   #ifdef USE_PAM
  691. !        extern struct pam_conv conv;
  692.   #endif /* USE_PAM */
  693.   
  694. --- 202,210 ----
  695.       char remotehost[2 * MAXHOSTNAMELEN + 1];
  696.   #ifdef USE_PAM
  697. !     char c;
  698. !     static struct pam_conv conv = {
  699. !       misc_conv,
  700. !       NULL
  701. !     };
  702.   #endif /* USE_PAM */
  703.   
  704. ***************
  705. *** 384,418 ****
  706.           (void) pam_set_item (pamh, PAM_RHOST, hostname);
  707.           (void) pam_set_item (pamh, PAM_TTY,   "/dev/tty");
  708. !         do {
  709. !                 retcode = pam_authenticate(pamh, 0);
  710. !                 if (retcode == PAM_SUCCESS)
  711. !                         retcode = pam_acct_mgmt(pamh, 0);
  712. !                 if (retcode == PAM_SUCCESS)
  713. !                         break;
  714. !                 if (retcode == PAM_AUTHTOKEN_REQD)
  715. !                         retcode = pam_chauthtok (pamh,PAM_CHANGE_EXPIRED_AUTHTOK);
  716. !         } while (retcode == PAM_SUCCESS);
  717.   
  718. !     if (retcode != PAM_SUCCESS) {
  719. !         pam_end(pamh,PAM_AUTH_ERR);
  720. !         exit (1);
  721.       }
  722. -         if (setgid(pwd->pw_gid) != 0) {
  723. -                 fprintf(stderr, "cannot assume gid\n");
  724. -                 exit (1);
  725. -         }
  726. -      if (initgroups(locuser, pwd->pw_gid) != 0) {
  727. -                 fprintf(stderr, "cannot initgroups\n");
  728. -                 exit (1);
  729. -         }
  730. -     retcode = pam_setcred(pamh, PAM_CRED_ESTABLISH);
  731.   
  732.       if (retcode != PAM_SUCCESS) {
  733. !         pam_end(pamh,PAM_CRED_ERR);
  734.       }
  735. !     retcode = pam_open_session(pamh,0);
  736.   #endif
  737.   
  738. --- 389,417 ----
  739.           (void) pam_set_item (pamh, PAM_RHOST, hostname);
  740.           (void) pam_set_item (pamh, PAM_TTY,   "/dev/tty");
  741. !     retcode = pam_authenticate(pamh, 0);
  742. !     if (retcode == PAM_SUCCESS)
  743. !       retcode = pam_acct_mgmt(pamh, 0);
  744. !     if (retcode == PAM_SUCCESS) {
  745. !       if (setgid(pwd->pw_gid) != 0) {
  746. !         fprintf(stderr, "Permission denied.\n");
  747. !         pam_end(pamh,PAM_SYSTEM_ERR);
  748. !         exit (1);
  749. !       }
  750.   
  751. !       if (initgroups(locuser, pwd->pw_gid) != 0) {
  752. !         fprintf(stderr, "Permission denied.\n");
  753. !         pam_end(pamh,PAM_SYSTEM_ERR);
  754. !         exit (1);
  755. !       }
  756. !       retcode = pam_setcred(pamh, PAM_CRED_ESTABLISH);
  757.       }
  758.   
  759. +     if (retcode == PAM_SUCCESS)
  760. +       retcode = pam_open_session(pamh,0);
  761.       if (retcode != PAM_SUCCESS) {
  762. !         pam_end(pamh,retcode);
  763. !         exit (1);
  764.       }
  765.   #endif
  766.   
  767. ***************
  768. *** 520,527 ****
  769.               remuser, hostname, locuser, cmdbuf);
  770.       }
  771. - #ifdef USE_PAM
  772. -        pam_end(pamh, PAM_SUCCESS);
  773. - #endif USE_PAM
  774.   
  775.       execl(pwd->pw_shell, cp, "-c", cmdbuf, 0);
  776. --- 519,522 ----
  777. diff -r -C2 --new-file NetKit-B-0.07/rusers/Makefile NetKit-B-0.07A/rusers/Makefile
  778. *** NetKit-B-0.07/rusers/Makefile    Mon Jul 15 17:31:13 1996
  779. --- NetKit-B-0.07A/rusers/Makefile    Fri Jul 26 01:32:10 1996
  780. ***************
  781. *** 4,9 ****
  782. --- 4,12 ----
  783.   include ../MRULES
  784.   
  785. + /* Doesn't compile cleanly with -Wall */
  786.   CFLAGS = -O2 -I ../include
  787.   
  788. + RPCGEN = ../rpcgen.new/rpcgen
  789.   rusers: rusers.o rusers_xdr.o rnusers_xdr.o
  790.       $(CC) $(LDFLAGS) $^ $(LIBS) -o $@
  791. ***************
  792. *** 19,33 ****
  793.   
  794.   rusers.h: ../include/rpcsvc/rusers.x
  795. !     ../rpcgen.new/rpcgen -h -o rusers.h ../include/rpcsvc/rusers.x
  796.   
  797.   rusers_xdr.c: ../include/rpcsvc/rusers.x
  798. !     ../rpcgen.new/rpcgen -c -C -o rusers_xdr.c ../include/rpcsvc/rusers.x
  799.   
  800.   rnusers_xdr.o: rnusers_xdr.c rnusers.h
  801.   
  802.   rnusers.h: ../include/rpcsvc/rnusers.x
  803. !     ../rpcgen.new/rpcgen -h -o rnusers.h ../include/rpcsvc/rnusers.x
  804.   
  805.   rnusers_xdr.c: ../include/rpcsvc/rnusers.x
  806. !     ../rpcgen.new/rpcgen -c -C -o rnusers_xdr.c ../include/rpcsvc/rnusers.x
  807.   
  808. --- 22,36 ----
  809.   
  810.   rusers.h: ../include/rpcsvc/rusers.x
  811. !     $(RPCGEN) -h -o rusers.h ../include/rpcsvc/rusers.x
  812.   
  813.   rusers_xdr.c: ../include/rpcsvc/rusers.x
  814. !     $(RPCGEN) -c -C -o rusers_xdr.c ../include/rpcsvc/rusers.x
  815.   
  816.   rnusers_xdr.o: rnusers_xdr.c rnusers.h
  817.   
  818.   rnusers.h: ../include/rpcsvc/rnusers.x
  819. !     $(RPCGEN) -h -o rnusers.h ../include/rpcsvc/rnusers.x
  820.   
  821.   rnusers_xdr.c: ../include/rpcsvc/rnusers.x
  822. !     $(RPCGEN) -c -C -o rnusers_xdr.c ../include/rpcsvc/rnusers.x
  823.   
  824. diff -r -C2 --new-file NetKit-B-0.07/telnet/externs.h NetKit-B-0.07A/telnet/externs.h
  825. *** NetKit-B-0.07/telnet/externs.h    Sat Jul 20 15:47:49 1996
  826. --- NetKit-B-0.07A/telnet/externs.h    Fri Jul 26 00:06:05 1996
  827. ***************
  828. *** 32,36 ****
  829.    *
  830.    *    from: @(#)externs.h    5.3 (Berkeley) 3/22/91
  831. !  *    $Id: externs.h,v 1.3 1996/07/20 19:47:39 dholland Exp $
  832.    */
  833.   
  834. --- 32,36 ----
  835.    *
  836.    *    from: @(#)externs.h    5.3 (Berkeley) 3/22/91
  837. !  *    $Id: externs.h,v 1.4 1996/07/26 04:05:03 dholland Exp $
  838.    */
  839.   
  840. ***************
  841. *** 71,74 ****
  842. --- 71,78 ----
  843.   #endif
  844.   #include <strings.h>
  845. + #ifdef __linux__
  846. + #include <unistd.h>   /* get _POSIX_VDISABLE */
  847. + #endif
  848.   
  849.   #ifndef    _POSIX_VDISABLE
  850. diff -r -C2 --new-file NetKit-B-0.07/telnetd/sys_term.c NetKit-B-0.07A/telnetd/sys_term.c
  851. *** NetKit-B-0.07/telnetd/sys_term.c    Tue Jul 16 04:58:31 1996
  852. --- NetKit-B-0.07A/telnetd/sys_term.c    Fri Jul 26 00:39:30 1996
  853. ***************
  854. *** 36,40 ****
  855.    */
  856.   char st_rcsid[] = 
  857. !   "$Id: sys_term.c,v 1.4 1996/07/16 08:58:22 dholland Exp $";
  858.   
  859.   #include "telnetd.h"
  860. --- 36,40 ----
  861.    */
  862.   char st_rcsid[] = 
  863. !   "$Id: sys_term.c,v 1.5 1996/07/26 04:39:19 dholland Exp $";
  864.   
  865.   #include "telnetd.h"
  866. ***************
  867. *** 450,457 ****
  868.           struct stat stb;
  869.   
  870. !         *p1 = "pqrstuvwxyzABCDE"[i];
  871.           *p2 = '0';
  872.           if (stat(line, &stb) < 0)
  873. !             break;
  874.           for (j = 0; j < 16; j++) {
  875.               *p2 = "0123456789abcdef"[j];
  876. --- 450,457 ----
  877.           struct stat stb;
  878.   
  879. !         *p1 = "pqrstuvwxyzabcde"[i];
  880.           *p2 = '0';
  881.           if (stat(line, &stb) < 0)
  882. !             continue;
  883.           for (j = 0; j < 16; j++) {
  884.               *p2 = "0123456789abcdef"[j];
  885.